package user.zc.excel.data.builder;

import user.zc.helper.ExcelAssistant;
import user.zc.helper.ReflectUtil;
import user.zc.exception.ExcelExceptionEnum;

import java.lang.reflect.Field;
import java.util.List;

public interface IBuilder<T,E> {
    E collect(Class<T> clazz);
    default List<Field> fields(Class<T> clazz){
        List<Field> list =   ReflectUtil.fields(clazz,(f)->f.getAnnotation(ExcelAssistant.class)!=null);
        ExcelExceptionEnum.LIST_IS_EMPTY.assertNotEmpty(list);
        return list;
    }
}
